<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!doctype html>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="index.css">
<title>新闻首页</title>

<script type="text/javascript">
	var Arr=['images/1.jpg','images/2.jpg','images/3.jpg','images/4.jpg','images/5.jpg'];
	var i = 0;
	function on_load() {
		document.getElementById("focus").style.background="url("+Arr[i]+")";
		if (++i == Arr.length) {
			i = 0;
		}
	}
	setInterval("on_load()",1500);
</script>

</head>
<body>

<div id="wrapper">
	<div id="header">
		<div class="header-left">
			<h2>时代!Era</h2>
	</div>

		
	<div class="header-right">
			<script type="text/javascript"> 
				var d = new Date();
				var vYear = d.getFullYear();
				var vMon = d.getMonth() + 1;
				var vDay = d.getDate();
				document.write(vYear);
				document.write("年") ;
				document.write(vMon<10 ? "0" + vMon : vMon); 
				document.write("月"); 
				document.write(vDay<10 ?  "0"+ vDay : vDay ); 
				document.write("日"); 
			</script>
	</div>
	<c:if test="${usrLogin==null }">
		<div id="header-login" >
				<a href="UserLoginAction.do" >登录</a>
				&nbsp;&nbsp;<a href="UserRegisterAction.do" >注册</a>
		</div>
	</c:if>
	<c:if test="${usrLogin!=null }">
			<div id="header-login" >
			   您好，${usrLogin}&nbsp;&nbsp;<a href="userRemove.do">注销</a>
			</div>
	</c:if>

		
	</div>

	<div id="nav">
		<div style="float:left">
		<ul>
			<li><a href="newsAction.do">首页</a></li>
			<li><a href="classAction.do?classId=4">科技</a></li>
			<li><a href="classAction.do?classId=3">军事</a></li>
			<li><a href="classAction.do?classId=2">娱乐</a></li>
			<li><a href="classAction.do?classId=1">体育</a></li>
		</ul>
		</div>
		<div id="search">
			<form method="post" name="form1" action="findListAction.do">
				<input type="text" name="title" />
				<input type="submit" value="搜索"/>
				
			</form>
		</div>
	</div>
	
	<div style="overflow:hidden;width:900px;height:295px">
   		<div id="focus"
				style="width:290px;height:290px;float:left;border:1px;background-image:url(images/5.jpg)">

		</div>
   		
   		<div style="width:290px;height:290px;float:right;padding:5px;">
     			  <a href="">最受欢迎：</a><hr>
     			  <marquee scrollamount="3" direction="up" onmouseover="this.stop()" onmouseout="this.start()">
     			  <c:forEach var="news" items="${topTenList}">
					   	<li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   	<a href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}"
					   		title="${news.title}">${news.title}</a></li>
					   	<br>
				</c:forEach>
				</marquee>
  		 </div>
		<div style="width:290px;height:290px;float:right;padding:5px;">
     			<a href="">最新新闻：</a><hr>
     			<marquee scrollamount="3" direction="up" onmouseover="this.stop()" onmouseout="this.start()">
     			
     				<c:forEach var="news" items="${recentList}">
     				
					   	<li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   	<a  href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}"
					   		title="${news.title}">${news.title}</a></li>
					   	<br>
					</c:forEach>
     			</marquee>
   		</div>
	</div><br>
	
	<div style="overflow:hidden;width:900px;height:290px">
   		<div style="width:900px;height:20px;border:1px solid gray;">
      			<a href="classAction.do?classId=4">科技：</a>
			 <div style= "float:right"><a href="classAction.do?classId=4">更多...</a></div><hr>
			 
   		</div><br>
   		
   		<div style="width:290px;height:290px;float:left;padding:0px;">
   			
   			
   			<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=18">
   					<image src="images/x24.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=16">
   					<image src="images/x28.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=17">
   					<image src="images/x26.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=19">
   					<image src="images/x22.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
     		 
  		 </div>
		<div style="width:590px;height:290px;float:right;padding:5px;">
     
					<ul>
					<c:forEach var="news" items="${techInfoList}">
					   	<li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   		<a  href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}" title="${news.title}">${news.title}</a></li>
					   	<br>
					</c:forEach>
					</ul>
   		</div>
	</div><br>

	<div style="overflow:hidden;width:900px;height:290px">
   		<div style="width:900px;height:20px;border:1px solid gray;">
      			<a href="classAction.do?classId=3">军事：</a>
			 <div style= "float:right"><a href="classAction.do?classId=3">更多...</a></div><hr>
			 
   		</div><br>
   		
   		<div style="width:290px;height:290px;float:left;">
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=11">
   					<image src="images/x39.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=12">
   					<image src="images/x38.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=13">
   					<image src="images/x34.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=3">
   					<image src="images/x37.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div> 
  		 </div>
		<div style="width:590px;height:290px;float:right;padding:5px;">
     	
					<ul>
					<c:forEach var="news" items="${milInfoList}">
					   	<li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   		<a  href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}" title="${news.title}">${news.title}</a></li>					   	<br>
					</c:forEach>
					</ul>
			
   		</div>
	</div><br>

	<div style="overflow:hidden;width:900px;height:290px">
   		<div style="width:900px;height:20px;">
      			<a href="classAction.do?classId=2">娱乐：</a>
			 <div style= "float:right"><a href="classAction.do?classId=2">更多...</a></div><hr>
   		</div><br>
   		
   		<div style="width:290px;height:290px;float:left;">
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=10">
   					<image src="images/704_1007205_330417.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=34"><image src="images/x2.jpg" width="140px" height="120px" style="border:0px;"></a>
   			</div>
   			
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=25">
   					<image src="images/x14.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=35">
   					<image src="" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>	 
  		 </div>
		<div style="width:590px;height:290px;float:right;padding:5px;">
     				
					<ul>
					<c:forEach var="news" items="${entertainmentInfoList}">
					   	<li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   	<a  href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}" title="${news.title}">${news.title}</a></li>
					   	<br>
					</c:forEach>
					</ul>	
   		</div>
	</div><br>

	<div style="overflow:hidden;width:900px;height:290px">
   		<div style="width:900px;height:20px;">
      			<a href="classAction.do?classId=1">体育：</a>
			 <div style= "float:right"><a href="classAction.do?classId=1">更多...</a></div><hr>
   		</div><br>
   		
   		<div style="width:290px;height:290px;float:left;">
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=24">
   					<image src="images/x15.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=21">
   					<image src="images/x18.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			
     		<div style="width:140px;height:130px;float:left;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=22">
   					<image src="images/x17.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div>
   			<div style="width:140px;height:130px;float:right;">
   				<a href="http://127.0.0.1:8080/news/main_text.jsp?news_id=23">
   					<image src="images/x16.jpg" width="140px" height="120px" style="border:0px;">
   				</a>
   			</div> 
  		</div>
		<div style="width:590px;height:290px;float:right;padding:5px;">
     	
					<ul>
					<c:forEach var="news" items="${sportsInfoList}">
					   <li style="width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#0000FF;line-height:20px;">
					   	<a  href="mainTextAction.do?newsId=${news.newsId }&classId=${news.classId}" title="${news.title}">${news.title}</a></li>
					   	<br>
					</c:forEach>
					</ul>	
   		</div>
	</div><br>

	<div id="footer">
		版权所有：五组成员<br>
		houstar@163.com
	</div>
 
</div>

</body>

</html>